#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->pushButton->setEnabled(true);
    ui->pushButton_2->setEnabled(false);
    connect(ui->pushButton,&QPushButton::clicked,ui->pushButton_2,[&]()
    {
        if(ui->pushButton_2->isEnabled())
        {
            ui->pushButton_2->setEnabled(false);
        }
        else
        {
             ui->pushButton_2->setEnabled(true);
             ui->pushButton->setEnabled(false);
        }
    });
    connect(ui->pushButton_2,&QPushButton::clicked,ui->pushButton,[&]()
    {
        if(ui->pushButton->isEnabled())
        {
            ui->pushButton->setEnabled(false);
        }
        else
        {
             ui->pushButton->setEnabled(true);
             ui->pushButton_2->setEnabled(false);
        }
    });
}
Widget::~Widget()
{
    delete ui;
}

